* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  padding: 30px 40px;
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: center;
}

h1 {
  font-size: 1.8rem;
  color: #17233d;
}

.description {
  color: #515a6e;
  margin-bottom: 15px;
}

h4 {
  font-size: 1rem;
  color: #515a6e;
  margin-bottom: 10px;
  text-align: left;
}

#file {
  display: none;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.main-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  width: 100%;
}

.upload-btn {
  background-color: #2d8cf0;
  flex-grow: 1;
}

.output-btn {
  background-color: #19be6b;
  flex-grow: 1;
}

.workspace {
  display: flex;
  gap: 25px;
  margin-top: 20px;
}

.preview-container,
.result-container {
  flex: 1;
}

.pre-view {
  width: 100%;
  height: 350px;
  background-color: #f8f8f9;
  border: 2px solid #dcdee2;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.pre-view img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  user-select: none;
}

#cropped-result {
  width: 100%;
  height: 350px;
  background-color: #f8f8f9;
  border: 2px solid #dcdee2;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#cropped-result canvas {
  max-width: 100%;
  max-height: 100%;
}

.hidden {
  display: none;
}

#crop-box {
  position: absolute;
  border: 2px solid #2d8cf0;
  cursor: move;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #fff;
  border: 1px solid #2d8cf0;
}

.handle.top-left {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}
.handle.top-right {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}
.handle.bottom-left {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}
.handle.bottom-right {
  bottom: -6px;
  right: -6px;
  cursor: nwse-resize;
}
